package com.book.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "bs_cart")   //1.绑定对应表名
public class Cart extends Model<Cart>{

    @TableId(type = IdType.AUTO)  //设置主键为 自动增加
    private Integer id;
    private Integer userId;
    private Integer bookId;
    private Integer count;

    //屏蔽book属性 与 bs_cart表中字段的映射关系
    @TableField(exist = false)
    private Book book;
}
